package com.application.race.manage;

import java.util.Random;

public class DEF {
	public static int MAX_FREE_MONEY=5; 	
	public static int EXCHANGE_RATE=1000; 
	public static int RECORDS_PER_PAGE=10;
	static public final int  FRAME_RATE = 15;
	static public final int  MAX_FRAME_RATE = 50;
	static public final int  MOVE_STEP = 20;
	static public final int  DIRECTION_UP      		= 0x00000000;
	static public final int  DIRECTION_DOWN 		= 0x00000100;
	static public final int  DIRECTION_LEFT 		= 0x00000200;
	static public final int  DIRECTION_RIGHT		= 0x00000300;
	static public final int  DIRECTION_UP_LEFT 		= 0x00000400;
	static public final int  DIRECTION_DOWN_LEFT 	= 0x00000500;
	static public final int  DIRECTION_UP_RIGHT 	= 0x00000600;
	static public final int  DIRECTION_DOWN_RIGHT 	= 0x00000700;
	static public final int  DIRECTION_STOP 		= 0x00000800;
	static public final double  BaseOddsCft=2;
	static public final double  BaseBonusCft=1;
	
	static public final String ACTION_HEAD="#ACT";
	static public final int  ACTION_MOVE=0;
	static public final int  ACTION_ACTION=1;
	static public final int  ACTION_CRASH=2;
	static public final int  ACTION_USEITEM=3;
	static public final int  ACTION_EFFECT=4;
	static public final int  ACTION_CASTSKILL=5;
	static public final int  ACTION_ADDITEM=6;
	
	static public final int  TILE_TYPE_NOTPASS = 0;
	static public final int  TILE_TYPE_BUILDING = 1;
	static public final int  TILE_TYPE_ROAD = 2;
	static public final int  TILE_TYPE_GRASS = 3;
	static public final int  TILE_TYPE_LAND = 4;
	static public final int  TILE_TYPE_SAND = 5;
	static public final int  TILE_TYPE_WATER = 6;
	static public final int  TILE_TYPE_ICE = 7;
	static public final int  TILE_TYPE_SNOW = 8;
	static public final int  TILE_TYPE_MUD = 9;
	static public final int  TILE_TYPE_HOLE = 10;
	
    static public final double[]  sinTable =
	    {0     ,0.2588 ,0.5    ,0.7071 ,0.866  ,0.9659 ,
	     1     ,0.9659 ,0.866  ,0.7071 ,0.5    ,0.2588 ,
	     0     ,-0.2588,-0.5   ,-0.7071,-0.866 ,-0.9659,
	     -1    ,-0.9659,-0.866 ,-0.7071,-0.5   ,-0.2588};
   static public final double[]  cosTable =
	    {1     ,0.9659 ,0.866  ,0.7071 ,0.5    ,0.2588 ,
	     0     ,-0.2588,-0.5   ,-0.7071,-0.866 ,-0.9659,
	     -1    ,-0.9659,-0.866 ,-0.7071,-0.5   ,-0.2588,
	     0     ,0.2588 ,0.5    ,0.7071 ,0.866  ,0.9659 };
   
	static Random rand=new Random();
	public static int random(int min,int max){
		if(min==max)return min;
		if(min>max){
			System.out.print("<<fatal error happend>> at CrashChecker.java  random(int,int) function");
			return 0;
		}
		return min+rand.nextInt(max-min);
	}
	public static int random(int a){
		return rand.nextInt(a);
	}
	
	public static double cDouble(Object p)
	{
		return ((Integer)p)*0.001;
	}
	
	public static int cInt(double p){
		return (int) p*1000;
	}
	
 
	
	static public final byte  CTS_FT_LOGIN     		= 0;
	static public final byte  CTS_FT_START     		= 1;
	static public final byte  CTS_FT_ACTION     		= 2;
	static public final byte  CTS_FT_SKILL     		= 3;
	static public final byte  CTS_FT_SKILL_STRICK     		= 4;
 
}
